<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .father {
      width: 400px;
      height: 400px;
      background-color: purple;
      margin-top: 30px;
      /*border: 1px solid purple;  解决外边距合并(塌陷)的问题*/
      /*padding: 1px;*/
      overflow: hidden;
    }
    .son {
      width: 200px;
      height: 200px;
      background: pink;
      margin-top: 50px;
    }
  </style>
</head>
<body>
  <div class="father">
    <div class="son"></div>
  </div>
</body>
</html>
